import { request } from '../utils/request.js'
// 新增购物车
export const addCartService = (data) =>
  request({ url: '/shoppingCart/addCart', method: 'POST', data })
// 根据userId获取用户购物车信息
export const getCartByUserId = (userId) =>
  request({ url: `/shoppingCart/findByUserId/${userId}` })
// 修改购物车信息
export const updateCartService = (data) =>
  request({ url: '/shoppingCart/updateCart', method: 'POST', data })

// 删除一条购物车数据
export const delCartItemService = (id) =>
  request({ url: `/shoppingCart/delCartItem/${id}`, method: 'DELETE' })

// 批量删除购物车数据
export const batchDeleteCart = (data) =>
  request({ url: '/shoppingCart/batchDeleteCart', method: 'PUT', data })
